<h1>Shop finders</h1>
<h6>Look for HBC's shops in your area</h6>

<br>



<p>
  Select your country and then a county/region
  and view the flagship stores, the showrooms and retailers
  where you can find our products
</p>

<p>


  <form name="country">
    <div align="left">
      Country:
      <select name="country_drop_down" onChange="window.location.href=this.options[this.selectedIndex].value;">

        <% if(@country_chosen!=nil) %>
        <option value="" >
          <%= @country_chosen.name %>
        </option>
        <% else %>
        <option value= ""> -- Choose the Country -- </option>
        <% end %>


        <% @countries.each do |country| %>
        <option value= <%= shopfinders_path(:country => country.id) %>>
          <%=country.name%>
        </option>
        <% end %>

      </select>
    </div>
  </form>


  <% if(@counties!=nil) %>
      <form name="county">
        <div align="left">
          County:
          <select name="county_drop_down" onChange="window.location.href=this.options[this.selectedIndex].value;">

            <% if(@county_chosen!=nil) %>
                <option value="" >
                  <%= @county_chosen.name %>
                </option>
                <option value=<%= shopfinders_path(:country => @country_chosen.id, :county=> @county_chosen.id) %> >
                  ----------
                </option>
            <% else %>
                <option value= ""> -- Choose the County -- </option>
            <% end %>

            <% @counties.each do |county| %>
                <option value= <%= shopfinders_path(:country => @country_chosen.id, :county=> county.id) %>>
                  <%=county.name%>
                </option>
            <% end %>

          </select>
        </div>
      </form>
  <% else %>
    <form name="county">
      <div align="left">
        County:
        <select name="county_drop_down">

          <option value= "none">
             -- Now choose the County --
          </option>

        </select>
      </div>
    </form>
  <% end %>

</p>




<% if(@shops!=nil) %>
        <br>
        <hr style="clear:both;"/>
        <br>
        <% i=1 %>
        <% @shops.each do |shop| %>
        <%= i %>) <%= link_to shop.name, shop_path(shop.id, :shopfinder=>true) %> (<%=shop.shop_type%>) <br>
            <%= shop.address %>  <br>
        <% i=i+1 %>
        <br>
        <% end %>

   <% if(@shops.length==0) %>
        <br>
        We are sorry there are no shops in this area
   <% end %>
<% end %>
